﻿using Compass.Wasm.Shared;
using Compass.Wasm.Shared.Purchases;
using Compass.Wasm.Shared.Wms;

namespace Compass.Wpf.ApiServices.Purchases;
public interface INavInvReportGroupService:IBaseService<NavInvReportGroupDto>
{
    Task<ApiResponse<NavInvReportGroupDto>> GetSingleByMonthAndGroupAsync(DateTime month,Group_e group);
}
public class NavInvReportGroupService:BaseService<NavInvReportGroupDto>,INavInvReportGroupService
{
    #region ctor
    private readonly HttpRestClient _client;
    private const string ServiceName = "NavInvReportGroup";
    public NavInvReportGroupService(HttpRestClient client) : base(client, ServiceName)
    {
        _client = client;
    }
    #endregion

    #region 扩展查询
    public async Task<ApiResponse<NavInvReportGroupDto>> GetSingleByMonthAndGroupAsync(DateTime month, Group_e group)
    {
        var request = new BaseRequest
        {
            Method = RestSharp.Method.Get,
            Route = $"api/{ServiceName}/MonthGroup?month={month}&group={group}"
        };
        return await _client.ExecuteAsync<NavInvReportGroupDto>(request);
    } 
    #endregion
}